package com.zxl.designpattern.structure.proxy;

/**
 * @author zxl
 * @version 1.0
 * @description 汽车销售代理商(静态代理)
 * @date 2025/6/1 14:15
 */
public class CarDealerProxy implements CarPurchase{

    private Customer customer;

    public CarDealerProxy(String name){
        customer = new Customer(name);
    }

    @Override
    public void purchase(String carModel) {
        preService();
        customer.purchase(carModel);
        afterService();
    }

    /**
     * 售前服务
     */
    private void preService(){
        System.out.println("买前服务：介绍车型优惠信息");
    }

    /**
     * 购车后服务
     */
    private void afterService(){
        System.out.println("买后服务：协助办理保险和上牌");
    }
}
